Skip to content

Conversation

@MelSumner
Copy link
Contributor

@MelSumner MelSumner commented Nov 12, 2025

Summary

Spelunking in our codebase to see if I can figure out the causes of, and solutions for, some of our flaky tests.

Details

Specific things that I've done as I've identified test errors (and tried to fix) and other changes/refactoring to try to reduce test flakiness:

  • use @embroider/macros for the link-to-external util
  • replaced the get in the intl service with a direct injection of the intl service (so that anything that uses our intl service is more stable and teardown safe due to delegation of ownership to the framework)
  • to support the above, moved ember-intl from devDep to Dep for component package.
  • added a isDestroyed/isDestroying guard/check to advanced table itself
  • add a little extra oomph for RAF in advanced table tests (the tests aren't getting the same help a consumer implementation would)
  • figured out why we needed to skip an assertion test in the tabs test, and updated the comment to reflect
  • fixed a skipped test in dropdown/toggle-icon by using waitFor from ember-test-helpers

More info

  • Tests are passing locally and in CI for all scenarios.
  • Relevant Jira ticket is HDS-5559.
  • We could really extract the hds-resolve-link-to-external util to be something like optionalLinkToExternal.gts which would remove the util and tighten up the component code that uses this util by quite a bit. But we should discuss.

@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
hds-showcase Ready Ready Preview Nov 18, 2025 5:41pm
hds-website Ready Ready Preview Nov 18, 2025 5:41pm


return undefined;
}
@service('intl') declare intl: IntlService;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zamoore I think this is how we are supposed to do it but I'm not 100%, worth a check though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this cause errors in codebases where ember-intl is not installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have, moved ember-intl from devDep to Dep for the components package, should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still not sure how we'd actually test this w/o creating an engines situation...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only tested in cloud-ui through RC, it only viable option without spinning another test app with engines, I guess we could create a failing test 🤔 in the showcase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to do an ember-try scenario

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shleewhite since we talked about it today I didn't make a lot of changes BUT a lot of tests that were consistently failing stopped failing after adding the destroyed/destroying check.

</Hds::AdvancedTable>`;

const hbsResizableColumnsAdvancedTable = hbs`<div style="width: 1000px;">
const hbsResizableColumnsAdvancedTable = hbs`{{!-- template-lint-disable no-inline-styles --}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting a lot of errors in our showcase and tests because we aren't taking the time to obey the linting rules or do types properly. Maybe this gets fixed with the refactor so we should just wait on it, but I've noted a few things just in case.

);
await focus(firstThElement);
await focus(firstReorderHandle);
// need to flush the frame to let the RAF waiter finish doing its thing
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what we need but also not sure why we're finding three things in the DOM and then focusing on two things in direct succession before asserting anything. Do we need the first focus? Could we find and focus the firstReorderHandle directly?

if (reorderedMessageText !== undefined) {
this.reorderedMessageText = reorderedMessageText;
} else {
} else if (!isDestroyed(this) && !isDestroying(this)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw: I tried a similar approach a while back and it seemed to solve the issue with hdsIntl service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants